package uc;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import cn.onekit.CALLBACK;

public class WizardBar extends LinearLayout {

	public WizardBar(Context context) {
		super(context);

	}

	public WizardBar(Context context, AttributeSet attrs) {
		super(context, attrs);

	}
	CALLBACK<Integer> callback;
	public void setData(String[] steps,final CALLBACK<Integer> callback) {
		this.callback=callback;
		this.removeAllViews();
		for (int i = 0; i < steps.length; i++) {
			Button button = new Button(getContext());
			button.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
			button.setTag(i);
			button.setOnClickListener(new OnClickListener(){

				@Override
				public void onClick(View v) {
					//callback.run(false, (Integer)v.getTag());
				}
				
			});
			button.setText(steps[i]);
			this.addView(button);
		}
	}
}
